extends Base1
var RUN_SPEED=50.00
@onready var monster=$"../.."
@onready var ani_sprite:AnimatedSprite2D=$"../../Graphics/AnimatedSprite2D"
func enter():
	if monster.health>0:
		ani_sprite.play("take_hit")
		print(monster.health)
	else:
		get_parent().change_state(3)
		return

func do():
	var vec:Vector2=Vector2.ZERO
	monster.velocity.x=vec.x*RUN_SPEED

func _on_animated_sprite_2d_animation_finished():
	if ani_sprite.animation=="Take_hit" and monster.health>0:
		get_parent().change_state(0)
	pass
